import { post } from '@/request/http'
import store from '@/store'

//区域中心创建/维护接口

// 列表查询接口
export const regionList = (data) =>
  post(
    '/FTKJWLHYPT/platform/getDepartment',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            dptFltId:store.state.user.FLT_UUID_DX_H,
            dptCode:data.dptCode,
            dptName:data.dptName
          }
        },
        Orderbys: {},
        PageIndexs: {
          FTKJWLHYPT:data.PageIndexs
        },
        PageSizes: {
          FTKJWLHYPT:data.PageSizes
        }
      }
    }
  )
  // 点击查看中的列表数据
export const regionListA = (data) =>
  post(
    '/FTKJWLHYPT/platform/getDepartmentUsers',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            dptFltId:store.state.user.FLT_UUID_DX_H,
            dptId:data.dptId,
          }
        },
      }
    }
  )

// 新增
export const addRegion = (data) =>
  post(
    '/FTKJWLHYPT/platform/addDepartment',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            dptFltId:store.state.user.FLT_UUID_DX_H,
            dptCode:data.dptCode ,
            dptName:data.dptName,
            dptPredptId:data.dptPredptId,
            dptRemark:data.dptRemark,
            dptSeq:data.dptSeq,
            dptType:data.dptType,
            dptDepId:data.dptDepId,
          }
        },
      }
    }
  )

// 编辑
export const delRegion = (data) =>
  post(
    '/FTKJWLHYPT/platform/editDepartment',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            dptFltId:store.state.user.FLT_UUID_DX_H,
            dptSeq:data.dptSeq,
            dptName:data.dptName,
            dptCode:data.dptCode,
            dptId:data.dptId,
            dptPredptId:data.dptPredptId,
          }
        },
      }
    }
  )

// 删除
export const eitdRegion = (data) =>
  post(
    '/FTKJWLHYPT/platform/deleteDepartment',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            dptId:data.dptId,
          }
        },
      }
    }
  )
// 区域中心下拉框
export const eitdRegionLX = () =>
  post(
    '/FTKJWLHYPT/platform/getDepartmentName',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            dptFltId:store.state.user.FLT_UUID_DX_H,
          }
        },
      }
    }
  )
  //上级机构
export const RegionSj = (data) =>
  post(
    '/FTKJWLHYPT/platform/getChildrenDptList',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            dptFltId:store.state.user.FLT_UUID_DX_H,
            dptType:data.dptType
          }
        },
      }
    }
  )
